package chixing.day10.singleton;

/**
 * 单例模式  singleton
 * 懒汉模式
 */
public class Library {
    private static Library library;

    private Library(){}

    //在客户端调用时才创建
    public static Library getInstance(){
        if (library == null)
            library = new Library();
        return library;
    }
}
